FROM consol/ubuntu-xfce-vnc

MAINTAINER LNTU205-EXPLORER "zbqhc@163.com"

USER 0

# ENV USERNAME explorer

RUN sed -i "s/archive.ubuntu.com/mirrors.tuna.tsinghua.edu.cn/g" /etc/apt/sources.list && sed -i "s/security.ubuntu.com/mirrors.tuna.tsinghua.edu.cn/g" /etc/apt/sources.list && apt-get clean -y && apt-get update 

RUN apt install software-properties-common apt-transport-https x11-xserver-utils libjpeg-turbo8-dev git zsh curl htop libeigen3-dev libeigen2-dev -y 

RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y && add-apt-repository ppa:jeff250/opencv -y

RUN find /etc/apt/sources.list.d/ -type f -name "*.list" -exec  sed  -i.bak -r  's#deb(-src)?\s*http(s)?://ppa.launchpad.net#deb\1 https\2://launchpad.proxy.ustclug.org#ig' {} \;

# RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1E9377A2BA9EF27F

RUN apt-get update

RUN apt install gcc-6 g++-6 -y && update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6

RUN apt install libopencv-dev -y

RUN sed -i "s/bg_sakuli.png/bg.png/g" /headless/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml

RUN ln -s /usr/share/applications/matlab-r2018b.desktop /headless/Desktop

RUN sh -c "$(wget https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh -O -)" "" --unattended && chsh -s /usr/bin/zsh && ln -s /usr/share/applications/xfce4-terminal.desktop /headless/Desktop && mkdir -p /headless/Desktop/workbench/tracker && mkdir -p /headless/Desktop/workbench/dataset && mkdir /run/media/explorer/Linux-Archive -p && ln -s /headless/Desktop/workbench/dataset /run/media/explorer/Linux-Archive

RUN apt install module-init-tools kmod -y

COPY ./matlab-r2018b.desktop /usr/share/applications/matlab-r2018b.desktop

COPY bg.png /headless/.config/bg.png


RUN apt install build-essential cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev -y

RUN ln -s /headless/Desktop/workbench /headless/workbench


# COPY cuda_9.1.85_387.26_linux.run /headless/Downloads/cuda_9.1.85_387.26_linux.run
# 
# COPY libcudnn7-dev_7.1.3.16-1+cuda9.1_amd64.deb /headless/Downloads/libcudnn7-dev_7.1.3.16-1+cuda9.1_amd64.deb
# 
# COPY libcudnn7_7.1.3.16-1+cuda9.1_amd64.deb /headless/Downloads/libcudnn7_7.1.3.16-1+cuda9.1_amd64.deb
# 
# RUN dpkg -i /headless/Downloads/libcudnn7* && chmod +x /headless/Downloads/cuda_9.1.85_387.26_linux.run && /headless/Downloads/cuda_9.1.85_387.26_linux.run --silent && rm /headless/Downloads/*
